package com.yswee.framework.widget.loading;

import com.yswee.framework.R;
import com.yswee.framework.widget.RotateView;
import com.yswee.framework.widget.layoutview.MRelativeLayout;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;

public class LoadingView extends MRelativeLayout<Void> {

	private RotateView rvloading;
	
	public LoadingView(Context context) {
		super(context);
	}
	
	public LoadingView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}
	
	@Override
	protected int getLayoutResId() {
		return R.layout.widget_loadingview;
	}
	
	@Override
	protected void onFindView() {
		super.onFindView();
		rvloading = (RotateView) findViewById(R.id.rvloading);
	}

	@Override
	protected void onApplyData() {
		setOnTouchListener(new OnTouchListener() {
			@Override
			public boolean onTouch(View v, MotionEvent event) {
				return true;
			}
		});
	}
	
	@Override
	public boolean onTouchEvent(MotionEvent event) {
		return true;
	}
	
	@Override
	public void setVisibility(int visibility) {
		super.setVisibility(visibility);
		rvloading.setVisibility(visibility);
	}

}
